package org.kugua.image;

import java.awt.image.BufferedImage;

/**
 * 图片选择器
 */
public interface ImageSelector<T> {

    /**
     * 选择Image
     *
     * @return T
     */
    T select();


    /**
     * 复制BufferImage
     *
     * @param original 原始对象
     * @return BufferedImage
     */
    default BufferedImage copy(BufferedImage original) {
        BufferedImage copy = new BufferedImage(original.getWidth(), original.getHeight(), original.getType());
        copy.getGraphics().drawImage(original, 0, 0, null);
        return copy;
    }
}
